package dl.bukkit.myststus.function.condition.imp;

import dl.bukkit.myststus.configuration.imp.Config;
import dl.bukkit.myststus.function.condition.ICondition;
import dl.bukkit.myststus.library.ats.GComponent;
import org.apache.commons.lang.math.NumberUtils;
import org.bukkit.entity.Player;

@GComponent(
        key = "level",
        author = "DogLong"
)
public class LevelCondition implements ICondition {
    @Override
    public boolean isRun(Player player, String value) {
        return player.getLevel() >= NumberUtils.toInt(value);
    }

    @Override
    public boolean isRegister() {
        return Config.getInst().getBoolean("Condition.Level");
    }
}
